<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/loginredirect.jsp"%>
<head>
    <title> <fmt:message key="menu.odjava"/></title>
    <meta name="heading" content="<fmt:message key='workPosition.workPosition'/>" />

  
    <meta name="menu" content="FormsMenu"/>
</head>



<div class="jquery_tab_container">
    <span class="heading_tab advanced_link active tab1"><fmt:message key="menu.odjava"/></span>
</div>

<div class="jquery_tab">
    <div class="content_block"></div>


<form:form class="popupDeleteForm" commandName="workPositionForm2" method="post" action="workpositionformodjava" id="workPositionForm2" onsubmit="return validateWorkPositionForm2(this)">
    <form:errors path="*" cssClass="error" element="div"/>
    <form:hidden path="workPosition.id"/>
 
    <p>
            <appfuse:label styleClass="width150 left" key="basicInfo.firstName"/>
            <form:input path="workPosition.employment.firstName" id="workPosition.employment.firstName" disabled="true" style="background-color: #ccc;" cssClass="left input-medium toCyr" cssErrorClass="text medium error" maxlength="50"/>
            <form:errors path="workPosition.employment.firstName" cssClass="fieldError"/>
            <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="basicInfo.lastName"/>
            <form:input path="workPosition.employment.lastName" id="workPosition.employment.lastName" disabled="true" style="background-color: #ccc;" cssClass="left input-medium toCyr" cssErrorClass="text medium error" maxlength="50"/>
            <form:errors path="workPosition.employment.lastName" cssClass="fieldError"/>
        <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="basicInfo.socScrNo"/>
            <form:input path="workPosition.employment.socScrNo" id="workPosition.employment.socScrNo" disabled="true" style="background-color: #ccc;" cssClass="left input-medium toCyr" cssErrorClass="text medium error" maxlength="50"/>
            <form:errors path="workPosition.employment.socScrNo" cssClass="fieldError"/>
       <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="workPosition.institution"/>
            <form:input path="workPosition.institution.institutionName" id="institutionSelect" disabled="true" cssClass="left input-medium" />
            <form:hidden path="workPosition.institution.id" id="workPosition.discriminator" cssClass="left input-medium" cssErrorClass="text medium error" />
    
            <form:hidden path="workPosition.discriminator" id="workPosition.discriminator" cssClass="left input-medium" cssErrorClass="text medium error" value="0"/>
      <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="workPosition.position"/>
            <form:input path="workPosition.position" id="workPosition.position" style="background-color: #ccc;"  cssClass="left input-medium toCyr" disabled="true" cssErrorClass="text medium error" maxlength="50"/>
            <form:errors path="workPosition.position" cssClass="fieldError"/>
        <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="workPosition.trialPeriod"/>
            <form:checkbox path="workPosition.trialPeriod" disabled="true" style="background-color: #ccc;"  id="workPosition.trialPeriod" cssClass="left input-medium" cssErrorClass="text medium error" />
            <form:errors path="workPosition.trialPeriod" cssClass="fieldError"/>
       <br class="clearer" />
            </p>

            <p>
            <appfuse:label styleClass="width150 left" key="workPosition.posType"/>
            <form:input path="workPosition.posType.posTypeName" style="background-color: #ccc;"  disabled="true" cssClass="left input-medium" id="posTypeSelect" />
             <form:hidden path="workPosition.posType.id" id="workPosition.discriminator"  cssErrorClass="text medium error" />

          <br class="clearer" />
            </p>

            <p>

       
            <appfuse:label styleClass="width150 left" key="workPosition.leaveReason"/>
            <form:select path="workPosition.leaveReason.id" id="leaveReasonSelect">
                <form:option id="1" value="">
                     <fmt:message key='leaveReasonSearch'/>
                </form:option>
                <c:forEach items="${workPositionForm2.leaveReason}" var="leaveReason">

                    <c:if test="${leaveReason == workPositionForm2.workPosition.leaveReason}">
                        <form:option value="${leaveReason.id}" id="${workPositionForm2.workPosition.leaveReason.id}" selected="true">
                            ${leaveReason.name}
                        </form:option>
                    </c:if>
                    <c:if test="${leaveReason != workPositionForm2.workPosition.leaveReason}">
                        <form:option value="${leaveReason.id}" id="${workPositionForm2.workPosition.leaveReason.id}" >
                            ${leaveReason.name}
                        </form:option>
                    </c:if>
                </c:forEach>
            </form:select>
<br class="clearer" />
            </p>

            <p>
             <appfuse:label styleClass="width150 left" key="workPosition.Date"/>
            <form:errors path="workPosition.startDate" cssClass="fieldError"/>
            <form:input path="workPosition.startDate" value="" name="flexy_datepicker" id="workPosition.startDate" cssClass="input-medium flexy_datepicker_input" cssErrorClass="text medium error" maxlength="50"/>
<br class="clearer" />
            </p>
      

  <form:hidden id="reasonDelete" path="savedReason.id"/>

        <p class="buttonBar bottom">
                   <c:if test="${workPositionForm2.isEditable == true}">
          <input type="submit" class="button"  name="save" value="<fmt:message key="button.save"/>"/>
           </c:if>
            <c:if test="${not empty workPositionForm2.workPosition.id and workPositionForm2.isEditable == true}">
            <input type="button" class="button" onclick="confirmDelete();"
                value="<fmt:message key="button.delete"/>" />
            </c:if>
            <input type="button" class="button" name="cancel" value="<fmt:message key="button.cancel"/>"  onclick="location.href='<c:url value="/workpositionsearch"/>'"  />
        </p>
    
</form:form>


<v:javascript formName="workPositionForm2" cdata="false" dynamicJavascript="true" staticJavascript="false"/>
<script type="text/javascript" src="<c:url value='/scripts/validator.jsp'/>"></script>
<script type="text/javascript">
    Form.focusFirstElement($('workPositionForm2'));
</script>

<div id="confirmdelete">
    <fmt:message key="delete.reasonDescription" />
    <select id="deleteReasonId">
        <c:forEach items="${workPositionForm2.deleteReason}" var="reason">
             <option value="${reason.id}">
                ${reason.name}
             </option>
        </c:forEach>
    </select>
</div>
</div>